#include <iostream>
using namespace std;

const int N = 100010;
int a[N];
int n;

int main()
{
    scanf("%d", &n);
    for (int i = 0; i < n; ++i)
        scanf("%d", a + i);
    for (int i = 0; i < n; ++i)
    {
        int j = 0;
        while (a[i])
            a[i] -= a[i] & -a[i], ++j;
        printf("%d ", j);
    }
    return 0;
}